telly=0:t$="":t=0:i$="":ch$="":alter=0:IF rings=0 THEN SomeAnswers
WHILE 1 AND alter<1
WHILE LOC(1)<>0
ch$=INPUT$(1,1)
equivs=ASC(ch$) AND 127:IF equivs<>1 THEN ch$=CHR$(equivs)
i$=i$+ch$:equivs=0
telly=telly+1:IF telly=78 THEN ch$=r$
IF ch$=CHR$(8) AND LEN(i$)>=2 THEN i$=LEFT$(i$,LEN(i$)-2):telly=telly-1
IF ch$=CHR$(10) OR ch$=CHR$(13) OR ch$=r$ THEN alter=3:telly=0
a$=ch$:GOSUB Modem:ch$=""
WEND
ch$=INKEY$:i$=i$+ch$
a$=ch$:GOSUB Modem
IF ch$=CHR$(10) OR ch$=CHR$(13) OR ch$=r$ THEN telly=0:GOTO MoreAnswers
IF ch$=CHR$(8) AND LEN(i$)>=2 THEN i$=LEFT$(i$,LEN(i$)-2)
ch$="":IF LEN(i$)=0 THEN connect=PEEK (&Hbfd*&H1000+&H0):IF connect<>0 THEN okp=0:RETURN
WEND
IF i$<>"" THEN MoreAnswers
SomeAnswers:
ch$=INKEY$:i$=i$+ch$:a$=ch$:GOSUB Modem
IF ch$= CHR$(10) OR ch$=CHR$(13) OR ch$=r$ THEN MoreAnswers
IF ch$=CHR$(8) AND LEN(i$)>=2 THEN i$=LEFT$(i$,LEN(i$)-2)
ch$=""
GOTO SomeAnswers
MoreAnswers:
IF okp<>1 THEN RETURN
IF i$="" THEN ch$="":GOTO Answers
t$=i$:IF LEN(t$)>80 THEN t$=LEFT$(t$,78)+r$
RETURN
SeqRead:
ERASE ABCS$:DIM ABCS$(185)
a$=r$+r$+"[> K Quits <]"+r$+r$:GOSUB Modem
OPEN "I", #3, file$
ReadSeq:
j=0:L=0:k=0:Countl=0
WHILE NOT EOF(3)
x=FRE(0):j=j+1
LINE INPUT#3,ABCS$(j):ABCS$(j)=ABCS$(j)+r$
WEND
CLOSE#3:k=j:L=0:Detect=0
WHILE L<k
L=L+1:a$=ABCS$(L):GOSUB Modem
CheckSeq:
t$="":t=0:i$="":ch$="":IF rings=0 THEN SomeCheckSeq
WHILE LOC(1)<>0
ch$=INPUT$(1,1):equivs=ASC(ch$) AND 127:IF equivs<>1 THEN ch$=CHR$(equivs)
i$=i$+ch$:equivs=0:a$=ch$:GOSUB Modem
WEND
IF i$<>"" THEN MoreCheckSeq
SomeCheckSeq:
ch$=INKEY$:i$=i$+ch$:a$=ch$:GOSUB Modem
OtherCheckSeq:
IF Detect=1 GOTO MoreCheckSeq
Countl=Countl+1:IF Countl=24 THEN a$=r$+"More (y,n,c)?":GOSUB A1
IF Countl=24 THEN MenS$=UCASE$(LEFT$(t$,1)):IF MenS$="N" THEN L=k+1
IF Countl=24 AND MenS$="Y" THEN Countl=0
IF Countl=24 AND MenS$="C" THEN Detect=1
IF Countl=24 AND Detect<>1 THEN Countl=0
MoreCheckSeq:
IF i$=CHR$(75) OR i$=CHR$(107) THEN L=k+1
WEND
RETURN
A1:
GOSUB Modem:GOSUB Answers:RETURN
Mail:
IF okp<>1 THEN RETURN
GOSUB CheckConTime:IF okp<>1 THEN RETURN
a$=r$+"Mail:":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="S" THEN MailScan
IF MenS$="R" THEN MailRead
IF MenS$="P" THEN Acd=0:GOSUB PostMail:GOTO Mail
IF MenS$="?" THEN file$="df1:mails/mailmenu":GOSUB SeqRead:GOTO Mail
IF MenS$="X" THEN RETURN
a$=r$+"No such command.":GOSUB Modem:GOTO Mail
MailScan:
IF eM=0 THEN a$=r$+"You don't have any mail.":GOSUB Modem:GOTO Mail
file$=Name1$+Name2$:GOSUB SpaceDelete
IF Email$(1)="1" THEN OPEN "I",#3,"df1:mails/"+file$+"1":FOR j=1 TO 2:LINE INPUT#3, ABCS$(j):NEXT j:CLOSE#3:a$=r$+ABCS$(1)+r$+ABCS$(2)+r$+r$:GOSUB Modem
IF Email$(2)="1" THEN OPEN "I",#3,"df1:mails/"+file$+"2":FOR j=1 TO 2:LINE INPUT#3, ABCS$(j):NEXT j:CLOSE#3:a$=r$+ABCS$(1)+r$+ABCS$(2)+r$+r$:GOSUB Modem
IF Email$(3)="1" THEN OPEN "I",#3,"df1:mails/"+file$+"3":FOR j=1 TO 2:LINE INPUT#3, ABCS$(j):NEXT j:CLOSE#3:a$=r$+ABCS$(1)+r$+ABCS$(2)+r$+r$:GOSUB Modem
IF Email$(4)="1" THEN OPEN "I",#3,"df1:mails/"+file$+"4":FOR j=1 TO 2:LINE INPUT#3, ABCS$(j):NEXT j:CLOSE#3:a$=r$+ABCS$(1)+r$+ABCS$(2)+r$+r$:GOSUB Modem
IF Email$(5)="1" THEN OPEN "I",#3,"df1:mails/"+file$+"5":FOR j=1 TO 2:LINE INPUT#3, ABCS$(j):NEXT j:CLOSE#3:a$=r$+ABCS$(1)+r$+ABCS$(2)+r$+r$:GOSUB Modem
CLOSE#3:GOTO Mail
MailRead:
IF eM=0 THEN a$=r$+"You don't have any mail.":GOSUB Modem:GOTO Mail
IF Email$(1)="1" THEN file$="df1:mails/"+Name1$+" "+Name2$+"1":lab=1:GOSUB SpaceDelete:GOSUB SeqRead:mfile$=file$:GOSUB MoreMailRead
IF Email$(2)="1" THEN file$="df1:mails/"+Name1$+" "+Name2$+"2":lab=2:GOSUB SpaceDelete:GOSUB SeqRead:mfile$=file$:GOSUB MoreMailRead
IF Email$(3)="1" THEN file$="df1:mails/"+Name1$+" "+Name2$+"3":lab=3:GOSUB SpaceDelete:GOSUB SeqRead:mfile$=file$:GOSUB MoreMailRead
IF Email$(4)="1" THEN file$="df1:mails/"+Name1$+" "+Name2$+"4":lab=4:GOSUB SpaceDelete:GOSUB SeqRead:mfile$=file$:GOSUB MoreMailRead
IF Email$(5)="1" THEN file$="df1:mails/"+Name1$+" "+Name2$+"5":lab=5:GOSUB SpaceDelete:GOSUB SeqRead:mfile$=file$:GOSUB MoreMailRead
a$=r$+"No More Mail.":GOSUB Modem:GOTO ExitMailRead
MoreMailRead:
a$=r$+"[R]eply [D]elete [N]ext e[X]it :":GOSUB A1
MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="D" THEN KILL mfile$:KILL mfile$+".info":eM=eM-1:Email$(lab)="0":GOTO MailRead
IF MenS$="X" THEN ExitMailRead
IF MenS$="N" THEN RETURN
IF MenS$="R" THEN Acd=1:GOSUB PostMail:GOTO MoreMailRead
GOTO MoreMailRead
PostMail:
IF Acd=1 THEN file$=ABCS$(2):GOSUB OtherSpaceDelete:RecipID$=file$:RecipID=VAL(RecipID$):GOTO MorePostMail
a$=r$+"Send to Whom?":GOSUB A1:Recip$=UCASE$(LEFT$(t$,LEN(t$)-1)):Recip$=Recip$+"="
IF LEN(Recip$)>25 THEN Recip$=LEFT$(Recip$,25)
RecipnaMe=LEN(Recip$)
Ddt=0:Dch=0
WHILE Ddt<1
Dch=Dch+1:uil$=STR$(Dch):uil$=RIGHT$(uil$,1)
OPEN "I",#3,"df1:Storehouse"+uil$
Dxq=0:Lmn=0:Dab=0
WHILE NOT EOF(3)
Dxq=Dxq+1
LINE INPUT#3, ABCS$(Dxq)
WEND
Dzz=0
WHILE Lmn<1
Dzz=Dzz+1
IF Recip$=LEFT$(ABCS$(Dzz),RecipnaMe) THEN Lmn=5:Dab=Dzz
IF Dzz=Dxq AND Lmn<>5 THEN Lmn=2
WEND
IF Lmn=5 THEN Ddt=5:RecipID$=RIGHT$(ABCS$(Dab),LEN(ABCS$(Dab))-RecipnaMe)
IF Lmn=2 AND Dch=6 THEN Ddt=3
CLOSE#3
WEND
IF Ddt=3 THEN a$=r$+"No Such User!":GOSUB Modem:RETURN
IF Acd=1 THEN ABCS$(1)="Time:"+TIME$+" "+"Date:"+DATE$
CLOSE#4:OPEN "R", #4, "df1:USER",120
FIELD #4, 1 AS check$,9 AS N1$,15 AS N2$,10 AS Co$,15 AS Adr$,10 AS CI$,10 AS STA$,3 AS AG$,9 AS PAS$,3 AS B1$,3 AS B2$,3 AS B3$,3 AS B4$,3 AS B5$,3 AS B6$,3 AS B7$,3 AS B8$,3 AS B9$,1 AS EM1$,1 AS EM2$,1 AS EM3$,1 AS EM4$,1 AS EM5$,3 AS Valu$
FIELD #4, 117 AS dump$,1 AS VTE1$,1 AS VTE2$,1 AS VTE3$
GET#4,RecipID:lab=0:Ddt=0
IF Acd=1 THEN Recip$=N1$+" "+N2$
IF Acd=1 THEN ABCS$(2)="Name:"+Name1$+" "+Name2$+" Subject:Reply ID:"+UserID$
IF EM1$="0" THEN lab=1:GOTO PostMoreMail
IF EM2$="0" THEN lab=2:GOTO PostMoreMail
IF EM3$="0" THEN lab=3:GOTO PostMoreMail
IF EM4$="0" THEN lab=4:GOTO PostMoreMail
IF EM5$="0" THEN lab=5:GOTO PostMoreMail
a$=r$+"Sorry "+Recip$+"'s Mailbox is full.":GOSUB Modem:CLOSE#4:RETURN
PostMoreMail:
ABCS$(3)=r$
a$=r$+"Enter Message: [Max. 40 lines] /EX to exit"+r$:GOSUB Modem
Extm=0:Ddt=3
WHILE Extm<1
Ddt=Ddt+1
a$=r$+STR$(Ddt-3)+":":GOSUB A1
ABCS$(Ddt)=t$
IF UCASE$(LEFT$(t$,3))="/EX" THEN Extm=1:Ddt=Ddt-1
IF Ddt=42 THEN a$=r$+"Last Line!":GOSUB Modem
IF Ddt=43 THEN Extm=1
WEND
QueryPostMail:
a$=r$+"S- Save L- List A- Abort R- Replace D- Delete I- Insert C- Continue :":GOSUB A1
IF t$=CHR$(10) OR t$=CHR$(13) OR t$=r$ THEN a$=r$+"Edit Aborted.":GOSUB Modem:GOTO QueryPostMail
ABCS$(44)=t$
a$=r$+"Replace:"+r$+ABCS$(Rln)+r$+"With:"+r$+ABCS$(44)+r$+"(Y or N):":GOSUB A1:MenS$=UCASE$(LEFT$(t$,1))
IF MenS$="N" THEN QueryPostMail
IF MenS$="Y" THEN ABCS$(Rln)=ABCS$(44):GOTO QueryPostMail
ExitMailRead:
CLOSE#2:OPEN "R", #2, "df1:USER",120
FIELD #2, 1 AS check$,9 AS N1$,15 AS N2$,10 AS Co$,15 AS Adr$,10 AS CI$,10 AS STA$,3 AS AG$,9 AS PAS$,3 AS B1$,3 AS B2$,3 AS B3$,3 AS B4$,3 AS B5$,3 AS B6$,3 AS B7$,3 AS B8$,3 AS B9$,1 AS EM1$,1 AS EM2$,1 AS EM3$,1 AS EM4$,1 AS EM5$,3 AS Valu$
FIELD #2, 117 AS dump$,1 AS VTE1$,1 AS VTE2$,1 AS VTE3$